Digital video streams typically represent video using a sequence of frames or still images. Each frame can include a number of blocks, which in turn may contain information describing the value of color, brightness or other attributes for pixels. The amount of data in a typical video stream is large, and transmission and storage of video can use significant computing or communications resources. Various approaches have been proposed to reduce the amount of data in video streams, including compression and other encoding techniques. In addition, video data can be transmitted or stored at varying spatial resolutions in order to save transmission or storage bandwidth.
Modern video codecs use block-based coding. Each frame is divided into different sizes of blocks. Prediction methods exploit spatial and temporal similarities between blocks to achieve high compression ratios. These prediction methods include inter-prediction methods that exploit temporal redundancies in the data by utilizing information from other frames to generate a prediction, and intra-prediction methods that exploit spatial redundancies to generate a prediction using information only from the current frame. To encode a block in a video frame, a prediction for a current block is created by identifying a best matching block from a reference frame and calculating a prediction residual by subtracting the reference block from the current block. The residual is then encoded and written to the bitstream. The decoder decodes the bitstream and gets the residual, adds it to the prediction to generate a reconstruction of the block. The reconstruction is used for further blocks in current or future frames as reference, which forms a closed-loop scheme.
For example, in certain video compression schemes, a video frame is first divided into basic encoding units called super blocks. The super blocks are further divided into rectangular or square partitions. For 64×64 super blocks, the partition sizes can range from 4×4 to 64×64. Prediction is then performed at the partition level. For each partition, the prediction residuals are generated, are transformed, and then the transform coefficients are quantized and coded before they are written to the bitstream.